<?php

class TestCase extends Illuminate\Foundation\Testing\TestCase
{

    /**
     * Creates the application.
     *
     * @return \Symfony\Component\HttpKernel\HttpKernelInterface
     */
    public function createApplication()
    {
        $unitTesting = true;

        $testEnvironment = 'testing';

        return require __DIR__.'/../../bootstrap/start.php';
    }

    /**
     * 自定义方法,对两个给定数组进行给定键的键值相等断言
     * @param array $origin
     * @param array $check
     * @param array $keys
     */
    public function assertTsEqualKeyToValue(array $origin, array $check, array $keys)
    {
        foreach ($keys as $key) {
            self::assertEquals($origin[$key], $check[$key]);
        }

    }

    /**
     * 自定义方法,断言给定数组含有指定键
     * @param array $keys
     * @param array $check
     */
    public function assertTsArrayHasKey(array $keys, array $check)
    {
        foreach ($keys as $key) {
            self::assertTrue(isset($check[$key]));
        }
    }

    /**
     * 自定义测试时数据库播种
     * @param $seeds
     */
    public function baseSeed($seeds)
    {
        array_map('self::seed', $seeds);
    }

}
